package com.kefu.z.intermediator.client;

import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;
/**
 * websocket处理类
 * @author Halo
 *
 */
public class ClientWebSocketHandler extends TextWebSocketHandler{
	
	/**
	 * js调用websocket.send时候，会调用该方法
	 */
	protected void handleTextMessage(WebSocketSession session,  
            TextMessage message) throws Exception {  
        super.handleTextMessage(session, message);  
        TextMessage returnMessage = new TextMessage(message.getPayload()+" received at server");  
        session.sendMessage(returnMessage);
    }  
	
}
